package db.exchange.message;

public enum OrderStatus {
	NEW(0), PARTFILL(1), FILLED(2), CANCELLED(4), REJECTED(8);

	private final int fixValue;

	private OrderStatus(int fixValue) {
		this.fixValue = fixValue;
	}

	public String getFixSuffix() {
		return "|54=" + fixValue;
	}

	public int getFixValue() {
		return fixValue;
	}

	public static OrderStatus getOrderStatusByIndex(String i) {
		switch (i) {
		case "0":
			return NEW;
		case "1":
			return FILLED;
		case "4":
			return CANCELLED;
		case "8":
			return REJECTED;
		default:
			return null;
		}

	}

}
